import {http} from "@/api/index";

const role = {
    getAllRoleList:'/role/findAll',
    addRole:'/role/add',
    updateRole:'/role/update',
    deleteRole:'/role/delete',
    queryRoleLike:'/role/queryLike'
}


export const getAllRoleList = ()=>{
    return http.request({
        url:role.getAllRoleList,
        method:'get'
    })
}
export const queryRoleLike = (roleLike)=>{
    return http.request({
        url:role.queryRoleLike,
        method:'get',
        params:{
            roleLike
        }
    })
}
export function addRole(params){
    return http.request({
        url:role.addRole,
        method:'post',
        data:params
    })
}
export function updateRole(params){
    return http.request({
        url:role.updateRole,
        method:'post',
        data:params
    })
}

export function deleteRole(roleId){
    return http.request({
        url:role.deleteRole,
        method:'get',
        params:{
            roleId
        }
    })
}
